while 1:
    a = input("请输入pm2.5的值（Q退出）：")
    if a == "Q":
        break
    else:
        pm = float(a)
        if 0 <= pm <= 50:
            print("优")
        elif 51 <= pm <= 100:
            print("良")
        elif 101 <= pm <= 150:
            print("轻度污染")
        elif 151 <= pm <= 200:
            print("中度污染")
        elif 201 <= pm <= 300:
            print("重度污染")
        elif pm > 300:
            print("严重污染")
